--重定向sg
do
    local states = {
        run_start = "lambris_fiend_run_start",
        run = "lambris_fiend_run",
        run_stop = "lambris_fiend_run_stop",
    }
    local function hasstate(self, name)
        local state = self.sg.states[name]
        return state
    end
    local oldHasState = StateGraphInstance.HasState
    function StateGraphInstance:HasState(statename, ...)
        if self.inst:HasTag("lambris_fiend") and states[statename] and hasstate(self, states[statename]) then
            return states[statename]
        end
        return oldHasState(self, statename, ...)
    end

    local oldGoToState = StateGraphInstance.GoToState
    function StateGraphInstance:GoToState(statename, params, ...)
        if self.inst:HasTag("lambris_fiend") and states[statename] and hasstate(self, states[statename]) then
            statename = states[statename]
        end
        return oldGoToState(self, statename, params, ...)
    end
end
